﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace AllPurposeCard
{
   public static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
           
            Application.Run(new Shenjiahao.xiaofei());
        }


        //验证登录
        public static bool CheckLogin(string zhangID, string pwd)
        {
            SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=AllPurposeCard;Integrated Security=True");

            conn.Open();
            string sql = string.Format(@"select count(*) from GuanLiTable where UserLoginID = '{0}' and [UserPassWord] = '{1}'", zhangID, pwd);
            SqlCommand com = new SqlCommand(sql, conn);

            int count = Convert.ToInt32(com.ExecuteScalar());

            if (count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }


    
}
